namespace AOITest.Enum;

public static class DeviceFormate
{
    [Flags]
    public enum DeviceCategory
    {
        Error = 0,
        NeedSplit = 1,
        NeedExcel = 2,
        NeedCheckSum = 3,
        NoneSplit = 4
    }

    public enum Device
    {
        N61295 = DeviceCategory.NoneSplit | DeviceCategory.NeedCheckSum,
        N62881C = DeviceCategory.NoneSplit | DeviceCategory.NeedCheckSum,
        N81295 = DeviceCategory.NeedSplit | DeviceCategory.NeedCheckSum,
        N81295C = DeviceCategory.NeedSplit | DeviceCategory.NeedCheckSum, 
        N81295D = DeviceCategory.NeedSplit | DeviceCategory.NeedCheckSum,
        N41881C = DeviceCategory.NeedExcel,
        N46307B = DeviceCategory.NeedExcel,
        unkown = DeviceCategory.Error
        
    }


    public static DeviceCategory GetDeviceCategory(string deviceName)
    {
        if (System.Enum.TryParse(deviceName, out Device device))
        {
            return (DeviceCategory)device;
        }
        else
        {
            return DeviceCategory.Error;
        }
    }
    
    
}